package Main4;
import java.util.Scanner;

class ArrayUtils{
	static PairResult findMinMax(double[] values){
		for (int i=0;i<values.length;i++) {
			for(int j=0;j<values.length-1;j++){
				if(values[i]>values[j]){
					double e;
					e=values[j];
					values[j]=values[i];
					values[i]=e;
				}
			}
		}
		PairResult p=new PairResult();
		p.min=values[values.length-1];
		p.max=values[0];
		return p;
		}
	
	
	
	
	static class PairResult{
	private double min;
	private double max;
	@Override
	public String toString() {
		return "PairResult [min=" + min + ", max=" + max + "]";
	}
	}
}


public class Main4 {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		double[] A=new double[n];
		for(int i=0;i<n;i++){
			A[i]=sc.nextDouble();
		}
System.out.println(ArrayUtils.findMinMax(A));
System.out.println(ArrayUtils.PairResult.class);
	}

}
